<%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/3/28
  Time: 18:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册页</title>
</head>
<body>
<%
    Cookie[] cooks = request.getCookies();//获取本地所有的Cookie对象
    String[] user = new String[] { "", "" }; //用户存储从cookie中获取的用户名和密码
    if (cooks != null) {
        for (int i = 0; i < cooks.length; i++) {
            if (cooks[i].getName().equals("userInfo")) {
                user = cooks[i].getValue().split("#");//通过分割split获取用户名和密码.
            }

        }
    }
%>

<form action="ceshi.jsp" method="get" >
    用户名:<input name="userName" type="text" value="<%=user[0]%>">
    密码:<input type="password" name="password"value="<%=user[1]%>">
    <input type="submit" value="注册">
</form>

</body>
</html>
